<?php

    /**************************************************************************************************
     *  File Defination 
     *  - Showing information from phpinfo()
     -------------------------------------------------------------------  
     *  Run on PHP versions 4 and 5
     -------------------------------------------------------------------
     *  Apprain : Content Management Framework <http://www.apprain.com/>
     *  Download link: http://www.apprain.com/download
     *  Docs link: http://www.apprain.com/docs
     -------------------------------------------------------------------
     *  License text http://www.opensource.org/licenses/mit-license.php 
     *  About MIT license <http://en.wikipedia.org/wiki/MIT_License/>
    *************************************************************************************************/

    ob_start();
    phpinfo();
    $s = ob_get_contents();
    ob_end_clean(); 
    
    $a = $mtc = array();
    if (preg_match_all('/<tr><td class="e">(.*?)<\/td><td class="v">(.*?)<\/td>(:?<td class="v">(.*?)<\/td>)?<\/tr>/',$s,$mtc,PREG_SET_ORDER))
    {
        foreach($mtc as $v)
        {
            if($v[2] == $this->get_tag('i',NULL,'no value'))
            {
                continue;
            }

            $a[$v[1]] = $v[2];
        }
    } 

    echo $this->get_tag("form",array('class'=>'app_form'));
    echo $this->callElement("default/tools/tool_bar",array("buttons"=>array(array("type"=>"back")),"title" => "PHP Info"));

    $Grid = App::Module('DataGrid')
               ->setDisplay('FormListing');

    foreach( $a as $key => $val):
        $Grid->addRow($this->get_tag('strong',NULL,$key),$val);
    endforeach;	
    $Grid->Render();

    //echo $this->callElement('default/tools/table_listing',array('t_head' => $t_head,'listing_data' => $data,'title' => 'PHP Info','link' => ''));	
    $this->get_tag('form',NULL,'/');

    echo $this->callElement("default/tools/tool_bar",array("buttons"=>array(array("type"=>"back")),"title" => NULL));
?>